/*
 * GComputerUser.java
 * Created on 18 juin 2007
 *
 * Glacéo Internet Platform
 * http://sourceforge.net/projects/chm/
 *
 * Copyright (c) 2005-2009, Jens and Jan Janke (VirtualHockey Project)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.hockeo.vhbase.data.dao.user;


import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;

import com.hockeo.vhbase.data.dao.IGEntity;
import com.hockeo.vhbase.seasoncycle.movemaking.IGMoveMaker;

/**
 * Represents a computer user that handles clubs that are currently not managed by human
 * users.
 *
 * @version $Id$
 * @author jjanke
 */
@Entity
@DiscriminatorValue( "CO" )
public class GComputerUser extends GUser
{
  @Column( name = "co_preferred" )
  private boolean            d_fPreferred;

  @Column( name = "co_impl_class_rr" )
  private String             d_strImplNameRoundRobin;

  @Column( name = "co_impl_class_rr_multi_round" )
  private String             d_strImplNameRoundRobinMultiRound;

  @Column( name = "co_impl_class_ko3" )
  private String             d_strImplNameKO3;

  /** Default parameterless constructor. */
  protected GComputerUser()
  {
    super();
  }

  /**
   * Indicates whether this user is the preferred one which should be used by default
   * for a club which has currently no manager.
   */
  public boolean isPreferred()
  {
    return d_fPreferred;
  }

  /**
   * Returns the name of the {@link IGMoveMaker} implementation class that is responsible
   * for executing moves for round robin style contest elements.
   */
  public String getImplNameRoundRobin()
  {
    return d_strImplNameRoundRobin;
  }

  /**
   * Returns the name of the {@link IGMoveMaker} implementation class that is responsible
   * for executing moves for round robin style multi-round contest elements (i.e. contest
   * elements where the goal account is used for subsequent rounds).
   */
  public String getImplNameRoundRobinMultiRound()
  {
    return d_strImplNameRoundRobinMultiRound;
  }

  /**
   * Returns the name of the {@link IGMoveMaker} implementation class that is responsible
   * for executing moves for KO3 (best-of-three) style contest elements.
   */
  public String getImplNameKO3()
  {
    return d_strImplNameKO3;
  }

  /*
   * @see com.hockeo.vhbase.data.GUser#getTypeCode()
   */
  @Override
  public String getTypeCode()
  {
    return "CO";
  }

  public Class<? extends IGEntity> getGEntityClass()
  {
    return GComputerUser.class;
  }
}
